-
Notifications
You must be signed in to change notification settings - Fork 219
Filter by Rating Block > Display a notice in the editor if the store has no products with ratings #7763
Conversation
…has no products with ratings.
The release ZIP for this PR is accessible via:
|
Script Dependencies ReportThe
This comment was automatically generated by the |
TypeScript Errors ReportFiles with errors: 431
assets/js/blocks/rating-filter/block.tsx
|
Size Change: +7.87 kB (+1%) Total Size: 983 kB
ℹ️ View Unchanged
|
Hey @vivialice! Would you please give feedback regarding the copy used here? "There are no products with ratings." is the one currently in use. Thanks! |
A note about e2e tests: while working on this issue, I noticed all e2e tests for the filter by rating block (among others) are temporarily disabled ( ref. #7744 ). For now, I'm not adding any tests to cover this new notice, but opening a separate issue to do so as soon as the tests are up and running again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for the PR! It's testing well on my end 🎉 . I left a couple of suggestions but otherwise, this is LGTM.
<Notice status="warning" isDismissible={ false }> | ||
<p> | ||
{ __( | ||
'There are no products with ratings.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can be more explicit to merchants here by mentioning that the block won't display on the front end until their store has reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's a good call: in fact, I believe we could be more explicit about this on other blocks as well, such as the Filter Attributes. Already tagged @vivialice here earlier: looking forward to hearing her thoughts about this copy.
Hey @nefeline ! Thanks for tagging me in this. I agree with @dinhtungdu, the store not currently having reviews doesn't mean they should feel like they should remove the block so I have a suggestion for improved copy:
Additionally, even if the store doesn't have any ratings I don't think we should hide the UI from them. I think we should display the notice and an example for the rating checklist as default. Right now there aren't styling settings available but eventually the user should be able to define these even if their store doesn't have ratings. (eg scenario - brand new store.) |
Thanks @vivialice !
Great call! Just to confirm that we are on the same page, is the following screenshot a correct representation of what you are envisioning here, allowing users to preview/update the content, settings, and color for the filter even when the store doesn't have any ratings yet? |
Yes, that's correct 👍 Just to check, is the vertical spacing between each filter option the same as the other lists? And I just noticed another thing! The block name should just be |
…gs, and color for the filter even when the store doesn't have any ratings yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @nefeline, the PR is testing well on my end, thanks for your updates! I have some questions about code reuse, please see the review comments for more details.
Thanks for the review @dinhtungdu 🙌 ! I initially kept preview mode x editorPreview mode separated in case we wanted to display different content on both, but considering they don't differ atm, I went ahead and adopted the consolidated approach as suggested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for your great updates! This is LGTM! 🚀
The release ZIP for this PR is accessible via:
|
Thanks again @dinhtungdu 🎉 ! Regarding the vertical spacing between each filter option previously discussed here: @vivialice please let me know what you think. IMO, it makes sense for us to ditch the pre-existing margin-bottom for this block and ensure spacing is consistent with other lists: depending on our decision I'll go ahead and open a separate PR to update it if needed 👍 . |
Fixes #7735
This PR ensures a notice is displayed in the editor whenever the Filter by Rating block is used in a store that has no products with ratings.
Additionally, per @vivialice's recommendation, we are now allowing users to preview/update the content, settings, and color for the filter even when the store doesn't have any ratings yet:
User Facing Testing
WooCommerce Visibility
Changelog